package com.intelligentpension.bleconnect

import android.annotation.SuppressLint
import android.bluetooth.BluetoothDevice
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * 版权：点赞 版权所有
 * author :赵航
 * @e-mail: zhaohangcn@gmail.com
 * time：2022/4/8
 * describe ：
 */
class ItemAdapter(layout:Int,list:MutableList<BluetoothDevice>):BaseQuickAdapter<BluetoothDevice,BaseViewHolder>(layout,list) {
    @SuppressLint("MissingPermission")
    override fun convert(holder: BaseViewHolder, item: BluetoothDevice) {
        var name=if (item.name==null){
            "未知"
        }else{
            item.name
        }
        holder.setText(R.id.name_text,name)
        holder.setText(R.id.address,item.address)
    }

}